<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <!-- 引入左侧文件 头部  底部 -->
<%@ include file="commons/header.jsp" %>


<div class="right_col" role="main" style="min-height: 1874px;">
<div id="echarts" style="min-height: 800px;">
<!-- jQuery -->
    <script src="${pageContext.request.contextPath }/statics/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath }/statics/js/echarts.common.min.js"></script>
    <script type="text/javascript">
    
    var x=[];
    var y=[];
    $.ajax({
		url      : "${pageContext.request.contextPath }/appInfo/fiandAppDownloadTop7",
		type     : "get",
		data     : null,
		dataType : "json",
		success  : function(msg){
			if(msg.code==0){
			   var jsonArr=msg.data;
			   for (var i = 0; i < jsonArr.length; i++) {
				x.push(jsonArr[i].softwarename);
				y.push(jsonArr[i].downloads);
			   }
			   var div=document.getElementById("echarts")
		       var initDiv=echarts.init(div);
		       initDiv.setOption(option);
			}else{
				alert("数据异常");
			}
		},
		error    : function(){
			alert("系统出现异常");
		}
	});
    option = {
    	    color: ['#3398DB'],
    	    tooltip : {
    	        trigger: 'axis',
    	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
    	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
    	        }
    	    },
    	    grid: {
    	        left: '3%',
    	        right: '4%',
    	        bottom: '3%',
    	        containLabel: true
    	    },
    	    xAxis : [
    	        {
    	            type : 'category',
    	            /* data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] */
    	            data:x,
    	            axisTick: {
    	                alignWithLabel: true
    	            }
    	        }
    	    ],
    	    yAxis : [
    	        {
    	            type : 'value'
    	        }
    	    ],
    	    series : [
    	        {
    	            name:'直接访问',
    	            type:'bar',
    	            barWidth: '60%',
    	            /* data:[10, 52, 200, 334, 390, 330, 220] */
    	            data:y
    	        }
    	    ]
    	};
      
    </script>
</div>


 </div>
        
 <%@ include file="commons/footer.jsp" %>

